import { createWebHistory, createRouter } from "vue-router";
import ComLogAndRes from "@/views/com_LonAndRes.vue"
import AiAssistant from "@/views/AiAssistant.vue";
import TestComponent from "@/views/TestComponent.vue";
import ReportView from '../views/ReportView.vue';

const routes = [


    // {
    //     path: '/',
    //     redirect: '/login' // 添加重定向到登录页
    // },
    {
        path: '/',
        name: 'LoginForm',
        component: ComLogAndRes,
        meta: {
            requiresAuth: false,
            title: '登录 - 智帷千里'
        }
    },
    {
        path: '/register',
        name: 'RegisterrForm',
        component: ComLogAndRes,
        meta: {
            requiresAuth: false,
            title: '注册 - 智帷千里'
        }
    },
    {
        path: '/ai-assistant',
        name: 'AiAssistant',
        component: AiAssistant,
        meta: {
            requiresAuth: true,  // 如果需要认证
            title: 'AI助手 - 智帷千里'
        }
    },
    {
        path: '/test',
        name: 'TestForm',
        component: TestComponent
    },
    {
        path: '/report',
        name: 'Report',
        component: ReportView
    },
    {
        path:'/flaw_main',
        name:'FlawMain',
        component: () => import('@/views/FlawWeb.vue'),
    },
    {
        path:'/flaw_FileWeb1',
        name:'FlawFileWeb1',
        component: () => import('@/components/flaw/FileWeb1.vue'),
    },
    {
        path:'/SqlWeb1',
        name:'SqlWeb1',
        component: () => import('@/components/flaw/SqlWeb1.vue'),
    },
];

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes,
});

export default router;
